<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

class PdUtils {
    public static function getChapterName($id){
        return Chapter::model()->findByPk($id)->name;
    }
    public static function getSequence($id,$table){
        $name='';
        if($table=='verse'){
            $name= Verse::model()->findByPk($id)->sequence;
        }else{
            switch ($table){
                case $table='chapter'; $name=  Chapter::model()->findByPk($id)->sequence;break;
                case $table='verse'; $name= Verse::model()->findByPk($id)->sequence;break;
                case $table='entry'; $name= Entry::model()->findByPk($id)->sequence;break;
            }
        }
        return $name;
    }
}